<template>
  <div>
    <template v-for="menu in navMenus">
      <!-- 叶子节点 如果此节点没有子菜单则生成路由 -->
      <el-menu-item v-if="!menu.children" :index="menu.path">
        <!--<i :class="menu.icon"></i>-->
        <i class="el-icon-menu"></i>
        <span slot="title"> {{ menu.name }}</span>
      </el-menu-item>

      <!-- 此菜单下还有子菜单 -->
      <el-submenu v-if="menu.children" :key="menu.id" :index="menu.path">
        <template slot="title">
          <!-- <i :class="navMenu.entity.icon"></i>-->
          <i class="el-icon-menu"></i>
          <span> {{ menu.name }}</span>
        </template>
        <!-- 递归 -->
        <nav-menus :navMenus="menu.children"></nav-menus>
      </el-submenu>
    </template>
  </div>
</template>
<script type="text/ecmascript-6">
    export default {
        name:"navMenus",
        props: ['navMenus'],
        data() {
            return {}
        },
        methods: {}
    }
</script>
